package domain.entities;

import javax.persistence.*;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Datasafetyreports entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "datasafetyreports", catalog = "bms")
public class Datasafetyreports implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date approvalMoh;
	private Date dated;
	private String description;
	private Date sentToCcis;
	private Date sentToExternalEc;
	private Date sentToLocalEc;
	private Date sentToMoh;
	private Date sentToSite;
	private Date sentToTc;
    private Integer scope;

    public static final String CLASSTITLE = "Data Safety Monitoring Committee reports";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
            Collections.unmodifiableMap(
                    new LinkedHashMap<String, String>() {
                        {
                            put("description", "Description");
                            put("dated", "Dated");
                            put("sentToSite", "Sent to Site");
                            put("sentToExternalEc", "Sent to External EC");
                            put("sentToLocalEc", "Sent to Local EC");
                            put("sentToTc", "Sent to Teaching Committee");
                            put("sentToMoh", "Sent to MOH");
                            put("approvalMoh", "MOH Approved/Notified");
                            put("sentToCcis", "Sent to CCIS if the site is located in Pcia. Bs. As.");
                        }
                    }
            )
    );


    // Constructors

	/** default constructor */
	public Datasafetyreports() {
	}

	/** minimal constructor */
	public Datasafetyreports(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public Datasafetyreports(ProtocoloCentro protocoloCentro, Date approvalMoh,
			Date dated, String description, Date sentToCcis,
			Date sentToExternalEc, Date sentToLocalEc, Date sentToMoh,
			Date sentToSite, Date sentToTc) {
		this.protocoloCentro = protocoloCentro;
		this.approvalMoh = approvalMoh;
		this.dated = dated;
		this.description = description;
		this.sentToCcis = sentToCcis;
		this.sentToExternalEc = sentToExternalEc;
		this.sentToLocalEc = sentToLocalEc;
		this.sentToMoh = sentToMoh;
		this.sentToSite = sentToSite;
		this.sentToTc = sentToTc;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "approvalMOH", length = 10)
	public Date getApprovalMoh() {
		return this.approvalMoh;
	}

	public void setApprovalMoh(Date approvalMoh) {
		this.approvalMoh = approvalMoh;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dated", length = 10)
	public Date getDated() {
		return this.dated;
	}

	public void setDated(Date dated) {
		this.dated = dated;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToCCIS", length = 10)
	public Date getSentToCcis() {
		return this.sentToCcis;
	}

	public void setSentToCcis(Date sentToCcis) {
		this.sentToCcis = sentToCcis;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToCentralEC", length = 10)
	public Date getSentToExternalEc() {
		return this.sentToExternalEc;
	}

	public void setSentToExternalEc(Date sentToExternalEc) {
		this.sentToExternalEc = sentToExternalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToLocalEC", length = 10)
	public Date getSentToLocalEc() {
		return this.sentToLocalEc;
	}

	public void setSentToLocalEc(Date sentToLocalEc) {
		this.sentToLocalEc = sentToLocalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToMOH", length = 10)
	public Date getSentToMoh() {
		return this.sentToMoh;
	}

	public void setSentToMoh(Date sentToMoh) {
		this.sentToMoh = sentToMoh;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToSite", length = 10)
	public Date getSentToSite() {
		return this.sentToSite;
	}

	public void setSentToSite(Date sentToSite) {
		this.sentToSite = sentToSite;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "sentToTC", length = 10)
	public Date getSentToTc() {
		return this.sentToTc;
	}

	public void setSentToTc(Date sentToTc) {
		this.sentToTc = sentToTc;
	}

    @Column(name = "scope")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }
}